package com.fyqp.controller;


import com.fyqp.pojo.Product;
import com.fyqp.pojo.ProductType;
import com.fyqp.service.IProductService;
import com.fyqp.service.IProductTypeService;
import com.fyqp.util.BaseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author efire
 * @since 2022-02-19
 */
@RestController
@RequestMapping("/product/type")
public class ProductTypeController {
    @Resource
    private IProductTypeService productTypeService;

    @PostMapping("/opr")
    public BaseResult oprPro(@RequestBody ProductType productType) {
        return productTypeService.oprPro(productType);
    }

    @PostMapping("/list")
    public BaseResult listAll() {
        return productTypeService.listAll();
    }

    @PostMapping("/queryWithId")
    public BaseResult queryWithId(@RequestBody ProductType productType) {
        return productTypeService.queryWithId(productType);
    }
}
